package java_test.nettest;

import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class TCPTest9 {
    public static void main(String[] args) {

    }

    public static void cloent() {
        Socket socket = null;
        OutputStream os = null;
        BufferedInputStream bis = null;

        try {
            //访问的服务器端口
            socket = new Socket(InetAddress.getByName("127.0.0.1"), 8899);
            //向服务器发送文件的输出流
            os = socket.getOutputStream();
            //读取本地文件的输入流
            bis = new BufferedInputStream(new FileInputStream(new File("file\\text\\text1.txt")));
            char[] buffere = new char[1024];
            int len;
            //while ((len = bis.read(buffere)) != - 1) {}
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {

        }
    }
}
